<!doctype html>
<html>
<head>
	<template source='TPL:common.head' load='true' />
	<link href="{@theme:css}/forum.css?v={@G:version}" rel="stylesheet" />
	<link href="{@theme:css}/editor_content.css?v={@G:version}" rel="stylesheet" />
<!--# if ($operateThread) { #-->
	<link href="{@theme:css}/management.css?v={@G:version}" rel="stylesheet" />
<!--# } #-->
<style>
.aPre{
	cursor:url({@theme:images}/common/pre.cur),auto;
}
.aNext{
	cursor:url({@theme:images}/common/next.cur),auto;right:0;
}
</style>
</head>
<body>
<pw-start/>
<div class="wrap">
	<template source='TPL:common.header' load='true' />
	<div class="main_wrap">
		<pw-drag id="main_segment"/>
		<div class="bread_crumb">
			{@$headguide|html}
		</div>
		<div class="main cc"><input type="hidden" id="js-tid" value="$tid" />
			<div class="read_page" id="J_posts_list">
				<pw-drag id="first_segment"/>
				<div id="app_test"></div>
				<div id="cloudwind_read_top"></div>
				<div class="cc mb10">
					<a rel="nofollow" href="{@url:bbs/post/run?fid=$pwforum->fid}" id="J_read_post_btn" class="btn_post{$postNeedLogin}">发帖</a>
					<!-- 锁定时间 -->
					<!--# if($showReply){ #-->
					<a rel="nofollow" href="{@url:bbs/post/reply?tid=$tid}" data-referer="true" class="btn_replay{$replyNeedLogin}">Trả lời</a>
					<!--# } #-->
					<div class="J_page_wrap" data-key="true">
						<div class="pages" style="margin-right:3px;"><a href="{@url:bbs/thread/run?fid=$pwforum->fid}" class="pages_pre">&laquo; 返回列表</a></div>
						<page tpl="TPL:common.page" page="$page" per="$perpage" count="$count" total="$totalpage" url="bbs/read/run?tid=$tid&fid=$fid" args="$urlargs"/>
					</div>
				</div>
				<!--# $designPermission = $loginUser->getPermission('design_allow_manage.push');
				 if ($operateThread || $designPermission > 0) { #-->
				<div class="read_management cc J_post_manage_col" data-role="readbar">
					<!--#
						$hasFirstPart = $operateThread['topped'] || $operateThread['digest'] || $operateThread['highlight'] || $operateThread['up'];
						$hasSecondPart = $operateThread['type'] || $operateThread['print'] || $operateThread['move'] || $operateThread['copy'] || $operateThread['unite'];
						$hasThirdPart = $operateThread['lock'] || $operateThread['down'] || $operateThread['delete'];
					#-->
					<!--# if ($operateThread['topped']){ #--><a data-type="norefresh" href="{@url:bbs/manage/topped}" class="">置顶</a><!--# } #-->
					<!--# if ($operateThread['digest']){ #--><a href="{@url:bbs/manage/digest}" class="">Chọn lọc</a><!--# } #-->
					<!--# if ($operateThread['highlight']){ #--><a href="{@url:bbs/manage/highlight}" class="">加亮</a><!--# } #-->
					<!--# if ($operateThread['up']){ #--><a href="{@url:bbs/manage/up}" class="">提前</a><!--# } #-->
					<!--# if ($hasFirstPart && $hasSecondPart){ #--><i>|</i><!--# } #-->
					<!--# if ($operateThread['type']){ #--><a href="{@url:bbs/manage/type}" class="">分类</a><!--# } #-->
					<!--# if ($operateThread['print']){ #--><a href="{@url:bbs/manage/unite}" class="">印戳</a><!--# } #-->
					<!--# if ($operateThread['move']){ #--><a href="{@url:bbs/manage/move}" class="">移动</a><!--# } #-->
					<!--# if ($operateThread['copy']){ #--><a href="{@url:bbs/manage/copy}" class="">复制</a><!--# } #-->
					<!--# if ($operateThread['unite']){ #--><a href="{@url:bbs/manage/unite}" class="">合并</a><!--# } #-->
					<!--# if ($hasThirdPart && ($hasFirstPart ^ $hasSecondPart || $hasFirstPart && $hasSecondPart)){ #--><i>|</i><!--# } #-->
					<!--# if ($operateThread['lock']){ #--><a href="{@url:bbs/manage/lock}" class="">锁定</a><!--# } #-->
					<!--# if ($operateThread['down']){ #--><a href="{@url:bbs/manage/down}" class="">压帖</a><!--# } #-->
					<!--# if ($operateThread['delete']){ #--><a href="{@url:bbs/masingle/delete}">Xóa</a><!--# } #-->
					<!--#
						if ($designPermission > 0) {
					#-->
					<!--# if ($hasFirstPart || $hasSecondPart || $hasThirdPart){ #--><i>|</i><!--# } #-->
					<a data-type="norefresh" href="{@url:design/push/add?fromtype=thread&fromid=$tid}" class="" title="推送">推送</a><!--这玩意交互改下class="mr10 J_manage_single" id="J_push_trigger"  以前的推送class="J_read_push" -->
					<!--# } #-->
				</div>
				<!--# } #-->
				<!--# foreach ($readdb as $key => $read) { #-->
				<a name="{$read['pid']}"></a><!--# if ($read['lou'] == $count-1) { #--><a name="a"></a><!--# } #-->
				<template source='read_floor' load='true' />
				<advertisement id='Read.Layer.TidAmong' sys='1'/>
				<!--# } #-->
				<page tpl="TPL:common.page_vertical" page="$page" per="$perpage" count="$count" total="$totalpage" url="bbs/read/run?tid=$tid&fid=$fid" args="$urlargs"/>
				<div class="floor">
					<table width="100%" style="table-layout:fixed;">
						<tr>
							<td class="floor_left_none">
							</td>
							<td>
								<a rel="nofollow" href="{@url:bbs/post/run?fid=$pwforum->fid}" id="J_read_post_btn" class="btn_post{$postNeedLogin}">发帖</a>
								<!-- 锁定时间 -->
								<!--# if($showReply){ #-->
								<a rel="nofollow" href="{@url:bbs/post/reply?tid=$tid}" data-referer="true" class="btn_replay{$replyNeedLogin}">Trả lời</a>
								<!--# } #-->
								<div class="J_page_wrap" data-key="true">
								<div class="pages" style="margin-right:3px;"><a href="{@url:bbs/thread/run?fid=$pwforum->fid}" class="pages_pre">&laquo; 返回列表</a></div>
								<page tpl="TPL:common.page" page="$page" per="$perpage" count="$count" total="$totalpage" url="bbs/read/run?tid=$tid&fid=$fid" args="$urlargs"/>
								</div>
							</td>
						</tr>
					</table>
				</div>
				<div class="floor box_wrap cc">
					<table width="100%" style="table-layout:fixed;" class="floor_table">
						<tr>
							<td class="floor_left">
								<div class="floor_info">
								<img class="J_avatar" data-type="small" src="{@Pw::getAvatar($loginUser->uid,'middle')}" width="120" height="120" alt="{$loginUser->username}" />
								</div>
							</td>
							<td class="floor_reply">
								<div class="reply_toolbar_wrap">
									<div class="reply_toolbar cc">
										<a href="{@url:bbs/post/reply?tid=$tid}" class="reply_high">进入高级模式&gt;&gt;</a>
										<a href="" style="display:;"  tabindex="-1" rel="nofollow" class="icon_face J_insert_emotions" data-emotiontarget="#J_reply_quick_ta">表情</a>
									</div>
									<textarea name="atc_content" aria-label="Gửi trả lời nhanh" id="J_reply_quick_ta" class="J_at_user_textarea" placeholder="Nhập nội dung trả lời"></textarea>
								</div>
								<div class="J_reply_ft">
									<button type="submit" data-tid="{$tid}" data-action="{@url:bbs/post/doreply?_getHtml=1}" class="btn btn_submit disabled" disabled="disabled" id="J_reply_quick_btn">Trả lời</button>
								</div>
							</td>
							<td class="floor_show">
								
							</td>
						</tr>
					</table>
				</div>
				<div style="display:none;" class="btn_post_menu" id="J_read_post_types">
					<ul>
						<!--# foreach ($pwforum->getThreadType($loginUser) as $key => $value) { #-->
							<!--# $_urladd_ = ($key != 'default') ? ('&special=' . $key) : ''; #-->
						<li><a href="{@url:bbs/post/run?fid=$pwforum->fid}{$_urladd_}" data-referer="true" class="{@trim($postNeedLogin)}">{$value[0]}</a></li>
						<!--# } #-->
					</ul>
				</div>
				<pw-drag id="read_bottom"/>
				<div id="cloudwind_read_bottom"></div>
			</div>
			<!--# if ($operateReply) { #-->
			<div id="J_post_manage_main" class="core_pop_wrap J_post_manage_pop" style="display:none;">
				<div class="core_pop">
					<div style="width:250px;">
						<div class="pop_top"><a href="#" id="J_post_manage_close" class="pop_close">关闭</a><strong>帖子操作</strong>(已选中&nbsp;<span class="red" id="J_post_checked_count">1</span>&nbsp;篇&nbsp;&nbsp;<a href="" class="s4" id="J_post_manage_checkall" data-type="check">Chọn tất</a>)</div>
						<div class="pop_cont">
							<div class="pop_operat_list">
								<ul class="cc J_post_manage_col" data-role="read">
									<!--# if ($operateReply['delete']){ #--><li><a data-type="delete" href="{@url:bbs/masingle/delete}">Xóa</a></li><!--# } #-->
									<!--# if ($operateReply['unite']){ #--><li><a href="{@url:bbs/masingle/unite}">合并</a></li><!--# } #-->
									<!--# if ($operateReply['split']){ #--><li><a href="{@url:bbs/masingle/split}">拆分</a></li><!--# } #-->
									<!--# if ($operateReply['shield']){ #--><li><a href="{@url:bbs/masingle/shield}">屏蔽</a></li><!--# } #-->
									<!--# if ($operateReply['remind']){ #--><li><a href="{@url:bbs/masingle/remind}">提醒</a></li><!--# } #-->
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--# } #-->
		</div>
	</div>
	<template source='TPL:common.footer' load='true' />
</div>

<textarea id="J_like_user_ta" class="dn">
	<div id="" class="core_pop_wrap" style="position:absolute;">
		<div class="core_pop">
			<div class="floot_like_pop">
				<div class="pop_top"><a href="#" class="pop_close J_like_user_close">关闭</a>最新喜欢</div>
				<div class="pop_cont">
					<ul class="cc J_like_user_list"></ul>
				</div>
			</div>
		</div>
	</div>
</textarea>
<!--# if(!$is_design) { #-->
<script>
var TID = '{$tid}';
Wind.use('jquery', 'global', 'dialog', function(){

	<!--# if ($loginUser->isExists()) { #-->
	//已登录

	//管理操作
	Wind.js(GV.JS_ROOT +'pages/bbs/threadForumManage.js?v='+ GV.JS_VERSION);

	$('a.J_read_mark').on('click', function(e) {
		e.preventDefault();
		var $this = $(this);
		$.post(this.href, function(data) {
			Wind.Util.resultTip({
				error : (data.state == 'success' ? false : true),
				elem : $this,
				follow : true,
				msg : data.message[0]
			});
		}, 'json');
	});

	//加关注
	$('a.J_read_follow').on('click', function(e) {
		e.preventDefault();
		var $this = $(this);
		Wind.Util.ajaxMaskShow();
		$.getJSON( this.href, function(data) {
			Wind.Util.ajaxMaskRemove();
			if(data.state == 'success') {
				$this.removeClass('follow').addClass('unfollow').text('已关注');
				Wind.Util.resultTip({
					msg : data.message[0],
					follow : $this
				});

				$('#J_user_card_'+ $this.data('uid')).remove();
			}else if( data.state == 'fail' ) {
				Wind.Util.resultTip({
					error : true,
					msg : data.message[0],
					follow : $this
				});
			}
		});
	});

		<!--# if ($operateReply['toppedreply'] && $read['lou']){ #-->
	/*
	 * //帖内置顶
	*/
	(function(){
		var top_lock = false;
		$('a.J_post_top').on('click', function(e){
			e.preventDefault();
			var $this = $(this),
				topped = $this.data('topped');

			if(top_lock) {
				return false;
			}
			top_lock = true;
			$.post(this.href, function(data){
				if(data.state == 'success') {
					Wind.Util.resultTip({
						follow : $this,
						msg : data.message[0],
						callback : function(){
							location.reload();
						}
					});
				}else if(data.state == 'fail') {
					Wind.Util.resultTip({
						error : true,
						follow : $this,
						msg : data.message[0]
					});
					top_lock = false;
				}
			}, 'json');
		})
	})();
		<!--# } #-->
	<!--# } #-->

	//无uid的个人中心地址
	//var U_CENTER_NOUID = '{@url:space/index/run}';

	// 阅读页的常用交互
	Wind.js(GV.JS_ROOT +'pages/bbs/read.js?v='+ GV.JS_VERSION);

	// Gửi trả lời nhanh&查看回复
	Wind.js(GV.JS_ROOT +'pages/bbs/readReply.js?v='+ GV.JS_VERSION);

	// 投票帖
	if($('ul.J_vote_item, a.J_vote_list_show').length) {
		Wind.js(GV.JS_ROOT +'pages/bbs/readVote.js?v='+ GV.JS_VERSION);
	}

	// 购买记录
	if($('#J_content_sell, #J_attach_buy, a.J_buy_record, .J_attach_post_del, a.J_attach_post_buy').length) {
		Wind.js(GV.JS_ROOT + 'pages/bbs/buyRecords.js?v=' + GV.JS_VERSION);
	}

	// 话题
	if($('#J_read_tag_wrap').length) {
		Wind.js(GV.JS_ROOT + 'pages/bbs/readTag.js?v=' + GV.JS_VERSION);
	}

	//媒体播放
	if( $('div.J_audio,div.J_video').length ) {
		Wind.js(window.GV.JS_ROOT + 'pages/bbs/media_play.js?v=' + GV.JS_VERSION);
	}


<!--# if(false != Wekit::C('bbs', 'read.image_lazy')) { #-->
	// 图片懒加载
	Wind.js(GV.JS_ROOT + 'util_libs/lazyload.js?v=' + GV.JS_VERSION, function(){
		$("img.J_lazy").lazyload({
	        effect: 'fadeIn',
	        error: function(settings){
	        	$(this).attr("src", '#').removeClass("J_lazy")
	        }
	    });
	});
<!--# } #-->
});
</script>
<!--# } #-->
<hook class='$threadDisplay' name="m_PwThreadDisplay.runJs" />
<pw-end/>
</body>
</html>